package miao.demo;

import miao.demo.dao.OrderDao;
import miao.demo.factory.OrderDaoFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/*
    目标：bean实例化--静态工厂
 */
public class AppForInstanceOrder {
    public static void main(String[] args) {
        /*OrderDao orderDao = OrderDaoFactory.getOrderDao();
        orderDao.save();*/

        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        OrderDao order = (OrderDao) ctx.getBean("orderDao");
        order.save();
    }
}
